package com.example.batterynotification;



public class Util {
	
	 public static String  MilliSecondsConvert(int milliSeconds)
	 {
	     int days=0,seconds=0,minutes=0,hours=0;
	      seconds=(milliSeconds/1000)%60;
	      minutes=((milliSeconds/1000)/60)%60;
	 	  hours =((milliSeconds/1000)/3600);
	 	if(hours>=24)
	 	{
	 	    days=hours/24;
	 	    hours%=24;
	 	    return (Integer.toString(days)+"d:"+Integer.toString(hours)+"h");
	 	}
	 	else
	 	{
	 	    if(hours>0)
	 	    	return (Integer.toString(hours)+"h:"+Integer.toString(minutes)+"m");	 	    	
	        else if(hours==0 && minutes>0)
	 	    	return (Integer.toString(minutes)+"m:"+Integer.toString(seconds)+"s");	        	
	         else   
		 	    return (Integer.toString(seconds)+"s");       	 
	 	    
	 	}

	 }

}
